package com.ruoyi.accounting.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 流水对象 acc_accounting_record
 *
 * @author ruoyi
 * @date 2025-07-13
 */
@Data
public class AccAccountingRecord extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    private Long id;

    /**
     * 账本id
     */
    @Excel(name = "账本id")
    private Long accountBookId;

    /**
     * 源账户id
     */
    @Excel(name = "源账户id")
    private Long sourceAccountId;

    /**
     * 目标账户id
     */
    @Excel(name = "目标账户id")
    private Long targetAccountId;

    /**
     * 流水类型
     */
    @Excel(name = "流水类型")
    private Integer recordType;

    /**
     * 分类id
     */
    @Excel(name = "分类id")
    private Long classificationId;

    /**
     * 金额
     */
    @Excel(name = "金额")
    private BigDecimal amount;

    /**
     * 流水时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "流水时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime recordTime;
    /**
     * 关联id
     */
    @Excel(name = "关联id")
    private Long referenceId;
    /**
     * 是否删除
     */
    private Integer delFlag;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("accountBookId", getAccountBookId())
                .append("sourceAccountId", getSourceAccountId())
                .append("targetAccountId", getTargetAccountId())
                .append("recordType", getRecordType())
                .append("classificationId", getClassificationId())
                .append("amount", getAmount())
                .append("recordTime", getRecordTime())
                .append("referenceId", getReferenceId())
                .append("createBy", getCreateBy())
                .append("updateTime", getUpdateTime())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("remark", getRemark())
                .append("delFlag", getDelFlag())
                .toString();
    }
}
